<template>
  <!-- 首页文章列表 -->
  <div class="content-container">
    <div class="content-header">
      <span class="content-header-title">{{dataList.title}}</span>
      <span class="content-header-more" @click="skip(dataList.path)">More</span>
    </div>
    <ul class="content-ground">
      <li
        class="content-item"
        v-for="(item, index) in dataList.list"
        :key="index"
        @click="skip(item.path)">
        <span class="content-item-text">{{item.title}}</span>
        <span>{{item.time}}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'Content',
  props: ['dataList'],
  methods: {
    // 路由跳转
    skip (path) {
      console.log(path+"未写路由模块，暂时跳转不了")
      // this.$router.push(path)
    }
  }
}
</script>

<style lang="less" scoped>
  .content-container {

    .content-header {
      height: 38px;
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;

      .content-header-title {
        font-size: 20px;
        font-weight: bold;
        border-bottom: 4px solid #006699;
        cursor: default;
      }

      .content-header-more {
        font-size: 16px;
        margin-top: 16px;
        color: #908c8c;
        cursor: pointer;

        &:hover {
          color: #1677cb;
          text-decoration: underline;
        }
      }
    }

    .content-ground {
      width: 100%;
      border: 2px solid #efeeee;
      padding: 10px 18px 15px;
      background-color: #fff;

      .content-item {
        padding-left: 32px;
        display: flex;
        justify-content: space-between;
        position: relative;
        color: #333333;

        span {
          font-size: 16px;
          line-height: 2.44;
        }

        .content-item-text {
          text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
        }

        &::before {
          font-family: "iconfont" !important;
          font-size: 18px;
          font-style: normal;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
          content: "\e777";
          position: absolute;
          left: 0px;
          top: 11px;
          color: #B0DEFF;
        }
        
        &:hover {
          color: #1677CB;
          cursor: pointer;

          &::before {
            color: #1677CB;
            cursor: pointer;
          }
        }
      }
    }
  }
</style>
